<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button id="wz">王者独角兽</button>
    <button id="sl">圣灵草王</button>
    <br>
    <img src="" alt="" >
    <script>
        //1,获取元素
        var btn1 = document.getElementById('wz');
        var btn2 = document.getElementById('sl');
        var img = document.querySelector('img');
        //2,注册事件
        btn1.onclick = function(){
            img.src = 'img1.png';
        };
        btn2.onclick = function(){
            img.src = 'img2.png';
        };
    </script>
</body>
</html>